<div class="r-group-new">
  <div class="r-group-panle-head">发起群聊</div>
  <div class="r-group-panel">

      <div >
        <div class="r-group-head" ng-class="{'selected':!showfriend}" ng-click="showfriend=false;">
          企业通讯录
        </div>
        <!--<div class="r-group-head" ng-class="{'selected':showfriend}" ng-click="showfriend=true;">
          好友
        </div>-->
      </div>
    <!--<div class="r-group-search">
      &lt;!&ndash; <input type="text" class="r-group-search-keyword r-input-focus" placeholder="搜索"/> &ndash;&gt;
      <search-input search="search(content)" content="content" control="searchControl" delay-time="0" show-text="搜索"></search-input>
      <a href="" class="r-input-clear" ng-click="clear()">X</a>
    </div>-->
    <div class="r-group-scroll">
      <div class="r-member-search" ng-show="content">
        <div class="r-members-item" ng-show="!showfriend" ng-repeat="staff in searchList">
          <div class="r-member-info" ng-click="addMember(staff)">
            <img ng-src="{{staff.imgSrc}}" src="assets/css/images/user.png" alt="">
            <span>{{staff.oaName}}</span>
          </div>
          <a href="" class="r-member-add">+</a>
        </div>
        <div class="r-members-item" ng-show="showfriend" ng-repeat="staff in searchList">
          <div class="r-member-info" ng-click="addMemberFromFriend(staff)">
            <img ng-src="{{staff.imgSrc}}" src="assets/css/images/user.png" alt="">
            <span>{{staff.name}}</span>
          </div>
          <a href="" class="r-member-add">+</a>
        </div>
      </div>
      <div class="r-group-info" ng-show="!content">
        <div ng-show="showfriend">
          <ul>
            <li class="r-group-friend"  ng-repeat="item in ::friendList" ng-click="addMemberFromFriend(item)">
              <img class="r-group-friend-portrait" ng-src="{{item.imgSrc||'assets/css/images/user.png'}}"/>
              <span>{{item.name}}</span>
            </li>
          </ul>
        </div>

        <organization ng-show="!showfriend" selection="addMember"></organization>
      </div>

    </div>
  </div>
  <div class="r-member-result">
    <div class="r-member-title">
      <h2>已选择的联系人(<span class="r-member-total">{{groupMember.length+disableRemove.length}}</span>)</h2>
    </div>
    <div class="r-member-selected">
      <div class="r-members-item" ng-repeat="item in groupMember">
        <div class="r-member-info">
          <img ng-src="{{item.imgSrc}}" src="assets/css/images/user.png" alt="">
          <span>{{item.name}}</span>
        </div>
        <a href="" class="r-member-remove" ng-if="loginuserid!==item.id" ng-click="removeMember(item.id)">X</a>
      </div>
      <div class="r-members-item" ng-repeat="item in disableRemove">
        <div class="r-member-info">
          <img ng-src="{{item.imgSrc}}" src="assets/css/images/user.png" alt="">
          <span>{{item.name}}</span>
        </div>
        <!-- <a href="" class="r-member-remove" ng-click="removeMember(item.id)">X</a> -->
      </div>
    </div>
    <div class="r-group-btns">
      <a href="" class="r-btn r-group-cancel" ng-click="closeThisDialog()">取消</a>
      <a href="" class="r-btn r-btn-ok r-group-ok" ng-if="!ngDialogData.groupid" ng-click="enterMember()">创建</a>
      <a href="" class="r-btn r-btn-ok r-group-ok" ng-if="ngDialogData.groupid" ng-click="updateMember()">修改</a>
    </div>
  </div>
</div>

<div class="r-group-name-pop" ng-show="showCreateGroup">
  <form class="" name='groupform' novalidate="true">

    <div class="r-group-name">
      <input type="text" placeholder="请输入群聊名" class="r-input-focus" name="groupname" ng-model="groupname" required/>
      <label>群聊创建后，群聊名不可修改。</label>
      <label ng-show="groupform.groupname.$invalid&&(groupform.submited||groupform.groupname.$dirty)" style="color:red;">群名称不可为空。</label>
    </div>
    <div class="r-group-btns">
      <a href="" class="r-btn r-group-cancel" ng-click="cancelCreate()">取消</a>
      <a href="" class="r-btn r-btn-ok r-group-ok" ng-click="groupform.submited=true;groupform.$valid&&createGroup()">创建</a>
    </div>

  </form>
</div>
